package com.bw.module_member

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.activity.viewModels
import com.alibaba.android.arouter.facade.annotation.Route
import com.blankj.utilcode.util.ToastUtils
import com.bw.lib_base.path.RouterPath
import com.bw.lib_common.entity.ParkingEntityItem
import com.bw.lib_common.view.BaseMvvmActivity
import com.bw.lib_common.view.BaseMvvmActivity1
import com.bw.lib_http.entity.MemberEntity
import com.bw.module_member.adapter.MemberAdapter
import com.bw.module_member.viewmodel.MemberViewModel
import com.yuwei.module_member.R
import com.yuwei.module_member.databinding.ActivityMemberBinding

@Route(path = RouterPath.MODULE_MEMBER_ACTIVITY)
class MemberActivity : BaseMvvmActivity1<ActivityMemberBinding,MemberViewModel>() {
    private lateinit var memberAdapter : MemberAdapter
    private lateinit var memberEntity: MemberEntity

    override fun initView() {
        memberEntity= MemberEntity()
        binding.topBar.tvTitle.text="月卡会员"
        binding.topBar.ivBack.setOnClickListener { finish() }
    }

    override fun initData() {
        vm.getMemberSuccess.observe(this){
            memberEntity=it
            binding.vip.setText(it.membershipLevel)
            binding.ri.text = it.registrationDate+" 到期"
        }
    }

    override fun onResume() {
        super.onResume()
        vm.MemberManage(117)
    }
}